﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FreedomERP.Comm;
using FreedomERP.Models;
using FreedomERP.Models.Inv;

namespace FreedomERP.Dao.Inv
{
    /// <summary>
    /// 欠货单接口
    /// 作者：陈新杰
    /// </summary>
    interface IInvShortageOrderDAO
    {
        /// <summary>
        /// 根据参数获取欠货单信息
        /// 作者：陈新杰
        /// </summary>
        /// <param name="paggingParams"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        DAOResult<InvShortageOrder> QueryShortageOrderPaggingByParam(PagingParams paggingParams, out int totalCount);

        /// <summary>
        /// 修改欠货单状态
        /// 作者：陈新杰
        /// </summary>
        /// <param name="fId"></param>
        /// <param name="modifierId"></param>
        /// <param name="statusID"></param>
        /// <returns></returns>
        DAOResult<String> updateShortageOrderStatus(String fId, String modifierId, String statusID);


        /// <summary>
        /// 根据参数获取欠货单详情信息
        /// 作者：陈新杰
        /// </summary>
        /// <param name="paggingParams"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        DAOResult<InvShortageOrderDetail> QueryShortageOrderDetailPaggingByParam(PagingParams paggingParams, out int totalCount);


      /// <summary>
      /// 修改欠货单详情
      /// </summary>
      /// <param name="fId"></param>
      /// <param name="fParentId"></param>
      /// <param name="returnNum"></param>
      /// <param name="modifierId"></param>
      /// <returns></returns>
        DAOResult<String> UpdateShortageOrderDetail(String fId,String fParentId,String returnNum, String modifierId);

        /// <summary>
        /// 添加缺货单
        /// </summary>
        /// <author>梁建东</author>
        /// <param name="shortageOrder"></param>
        void addShortageOrder(InvShortageOrder shortageOrder);

        /// <summary>
        /// 保存修改
        /// </summary>
        /// <author>梁建东</author>
        /// <returns></returns>
        void Save();

         /// <summary>
        /// 根据FId获取缺货单
        /// 作者：梁建东
        /// </summary>
        InvShortageOrder GetShortageOrderByFId(String FId);

        /// <summary>
        /// 为送货单创建欠货单（没有提交事务）
        /// </summary>
        /// <param name="shortageOrderNew"></param>
        /// <param name="creatorId"></param>
        /// <param name="FNumber"></param>
        void createShortageOrderOfSendOrder(FreedomERPEntities dbEntities,InvShortageOrder shortageOrderNew, string creatorId, out string FNumber);
        
    }
}
